package com.heima.search.controller;

import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.search.dto.UserSearchDto;
import com.heima.search.service.UserSearchService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping(path = "/api/v1/article/search")
public class UserSearchController {

    @Resource
    private UserSearchService userSearchService;

    /**
     * 用户关键词搜索功能
     *
     * @param dto
     * @return
     */
    @PostMapping(path = "/search")
    public ResponseResult search(@RequestBody UserSearchDto dto) {
        return userSearchService.search(dto);
    }
}
